<?php
/**
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file license.txt or that can be found at 
 * http://code.google.com/p/billboardce/wiki/License.
 *
 * @package    Oauth_Signature_Method_PLAINTEXT
 * @category   Library
 * @license    http://code.google.com/p/billboardce/wiki/License New BSD License
 * @version    SVN: $Id: $
 */

/**
 * @package    Oauth_Signature_Method_PLAINTEXT
 * @category   OAuth
 */
class Oauth_Signature_Method_PLAINTEXT extends Oauth_Signature_Method 
{
	
    public function getName()
    { 
		return "PLAINTEXT";
	}
	
	public function buildSignature($request, $consumer, $token)
	{ 
		$sig = array (Oauth_Util::urlencodeRfc3986($consumer->secret));
		
		if ($token) {
			array_push($sig, Oauth_Util::urlencodeRfc3986($token->secret));
		} else {
			array_push($sig, '');
		}
		
		$raw = implode("&", $sig);
		// for debug purposes
		$request->baseString = $raw;
		
		return Oauth_Util::urlencodeRfc3986($raw);
	}
}